Today we explore an interesting raster and vector data related to Japan. There are several interesting point to observe:
With those in mind let’s begin.
I use simple feature (sf) objects as they allow tidyverse manipulations. For more info on those please refer to this book
library(tidyverse)
library(ggrepel)
library(lubridate)
library(maptools)
library(ggpubr)
library(ggmap)
library(leaflet)
library(rgdal)
library(raster)
library(sf)
library(stringr)
bnd <- read_sf("gm-jpn-all_u_2_2/gm-jpn-all_u_2_2/polbnda_jpn.shp")
prefectures <- bnd %>%
dplyr::select(nam, laa) %>%
as.data.frame() %>%
dplyr::select(-geometry)
bnd <- bnd %>%
filter(pop > 0) %>%
group_by(laa) %>%
summarise(pop = sum(pop))
rails <- read_sf("gm-jpn-all_u_2_2/gm-jpn-all_u_2_2/raill_jpn.shp")
roads <- read_sf("gm-jpn-all_u_2_1/gm-jpn-all_u_2_1/roadl_jpn.shp")
airport <- read_sf("gm-jpn-all_u_2_2/gm-jpn-all_u_2_2/airp_jpn.shp")
dir("gm-jpn-lu_u_1_1/gm-jpn-lu_u_1_1/jpn")
## [1] "lu.aux" "lu.tfw" "lu.tif" "Read_me.txt"
#Those classifications are from 2006
#V 1.1
lu <- raster('gm-jpn-lu_u_1_1/gm-jpn-lu_u_1_1/jpn/lu.tif')
lc <- raster('gm-jpn-lc_u_1_1/gm-jpn-lc_u_1_1/jpn/lc.tif')
elev <- raster('gm-jpn-el_u_1_1/gm-jpn-el_u_1_1/jpn/el.tif')
Few of my first impressions of the vector and raster data: * The polylines of both roads and rails only highlight major transport lines. * The the buildup category of the land classification (LC) underestimated the area compared to the land use (LU) raster, both from 2006. * Some of the wards (municipalities) have no raster values for buildup area.
Having these in mind I implemented the following logic to derive the transport hub and urban density products:
## although coordinates are longitude/latitude, st_intersects assumes that they are planar
## although coordinates are longitude/latitude, st_intersects assumes that they are planar
The following map signifies where most of the population lives. The administrative unit is ward.
The map below show the wards which have more than 20% build up area (as per LU classification from 2006). The color highlights the population density in their urban areas. NB: LU is now 12 years old. Population data is from 2016. The popups will show you how much people are estimated to live in a square km, as well as the name of the ward.
Using the methods described above I also present to you the distribution of transport lines (roads and rail tracks) among the wards across Japan.